{include file='public/header'}
<style>
	.w_section1 .right .a1{
		height: auto;
	}
</style>
<body>
	<div class="q_section1">
		<div class="container clearfix">
			<div class="a2">
				<form action="">
					<div class="f1">
						<img src="__PUBLIC__/home/images/a20.png" alt="" class="im1">
						<input type="text" class="input1" >
					</div>
				</form>
			</div>
			<div class="a3">
				<a href="{:url('Notice/index')}">
					<img src="__PUBLIC__/home/images/a21.png" alt="">
					<p class="p1">消息</p>
				</a>
			</div>
		</div>
	</div>
	<div class="w_section1 clearfix">
		<div class="left">
			<ul>
				{foreach $cate_list as $cate}
				<li data-href_id="a{$cate.id}">
					<a href="#a{$cate.id}">{$cate.title}</a>
				</li>
				{/foreach}
			</ul>
		</div>
		<div class="right">
			{foreach $cate_list as $c}
			<div class="a1" id="a{$c.id}">
				<div class="title">
					<span class="s1"></span>
					<span class="s2">{$c.title}</span>
					<span class="s1"></span>
				</div>
				<div class="list">
					<img src="__PUBLIC__/home/images/a27.png" alt="">
					<spam class="s1">品牌推荐</spam>
				</div>
				<div class="item">
					<ul class="clearfix">
						{foreach $c.brand_list as $brand}
						<li>
							<a href="{:url('Goods/index', ['brand_id'=>$brand.id, 'cate_id'=>$c.id])}">{$brand.title}</a>
						</li>
						{/foreach}
					</ul>
				</div>
				<div class="center">
					<ul class="clearfix">
						{foreach $c.child_list as $c_item}
						<li>
							<a href="{:url('Goods/index', ['cate_id'=>$c_item.id])}">
								<img src="{$c_item.img_url}" alt="">
								<p class="p1">{$c_item.title}</p>
							</a>
						</li>
						{/foreach}
					</ul>
				</div>
			</div>
			{/foreach}
		</div>
	</div>
	{include file='public/tabbar'}

</body>
<script>
	$(function(){
		$(".w_section1").css("height",($(window).height()-105));
		$(".w_section1 .right").css("width",($(window).width()-92));
		$(".w_section1").on("click", "li", function () {
			$(this).siblings().removeClass("select");
			$(this).addClass("select");
		});
		var s = location.href.split("#");
		if(s.length == 2){
			$(".left ul li").each(function (i,v) {
				if($(this).data("href_id") == s[1]){
					$(this).trigger("click");
				}
			});
			$(".right div").each(function () {
				if($(this).attr("id") == s[1]){
					let offset = $(this).offset().top-45;
					$(".right").animate({ scrollTop:offset}, 200);
				}
			})
		}

	})
</script>
</html>